/*
 *  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 *
 */
package com.google.code.bigyang.config;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import com.google.code.bigyang.base.Filter;
import com.google.code.bigyang.base.Handler;

public class Configuration {

	private int soTimeout = Constant.SO_TIMEOUT;
	
	private int acceptorPort = Constant.ACCEPT_PORT;
	
	private Map<Option, Object> options = new HashMap<Option, Object>();
	
	private Handler handler;
	
	private Set<Filter> filters = new HashSet<Filter>();
	
	private int bufferSize = Constant.BUFFER_SIZE;
	
	private boolean isDirect = Constant.IS_DIRECT_BUFFER;
	
	public void addHanlder(Handler handler) {
		this.handler = handler;
	}
	
	public void addFilter(Filter filter) {
		filters.add(filter);
	}
	
	public Handler getHanlder() {
		return this.handler;
	}
	
	public Set<Filter> getFilters() {
		return this.filters;
	}
	
	public int getSoTimeout() {
		return soTimeout;
	}

	public int getAcceptorPort() {
		return acceptorPort;
	}

	public void setSoTimeout(int soTimeout) {
		this.soTimeout = soTimeout;
	}

	public void setAcceptorPort(int acceptorPort) {
		this.acceptorPort = acceptorPort;
	}

	public Map<Option, Object> getOptions() {
		return options;
	}

	public void setOptions(Map<Option, Object> options) {
		this.options = options;
	}

	public int getBufferSize() {
		return bufferSize;
	}

	public boolean isDirect() {
		return isDirect;
	}

	public void setBufferSize(int bufferSize) {
		this.bufferSize = bufferSize;
	}

	public void setDirect(boolean isDirect) {
		this.isDirect = isDirect;
	}
	
}
